#pragma once
#include <string>
#include <sstream>
#include <vector>

#include <d3d11_1.h>

#include "IComponent.h"
#include "IRenderable.h"

#include "tinyxml2.h"
#include "assimp\Importer.hpp"
#include "assimp\postprocess.h"
#include "assimp\scene.h"
#include "assimp\material.h"

#include "Model.h"
#include "Camera.h"
#include "SceneGraph.h"
#include "Material.h"
#include "Mesh.h"
#include "Position.h"
#include "Normal.h"
#include "Color.h"
#include "UV.h"

using namespace std;
using namespace tinyxml2;

class Scene : virtual public IComponent, IRenderable
{
public:
	Scene(void);
	~Scene(void);

	virtual void Initialize(HWND WindowHandle = nullptr, HINSTANCE hInstance = nullptr, ID3D11Device* Device = nullptr, ID3D11DeviceContext* DeviceContext = nullptr);
	virtual void Update(int DeltaTime);
	virtual void Shutdown();

	virtual void Render();

	void LoadScene(char *FileName);
	void LoadScene2(char *FileName);
	void SetCamera(Camera* cam);

private:
	void CompileShaderFromFile( WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut );
	bool fexists(string filename);
	std::vector<string> split(const std::string &s, char delim);

	Camera*	ViewCamera;
	vector<Model> Models;

	vector<Material> Materials;
	vector<Mesh> Meshes;

	ID3D11Device *D3DDevice;
	ID3D11DeviceContext* D3DDeviceContext;
};

